Dear <%= @name %>,

Following changes were made to reservation(s) to which you are assigned as an instructor:

<% @reservations.each{|reservation|%>--------------------------------------------------------<%a = reservation.attributes_before_type_cast%>
ORIGINAL RESERVATION:
Pilot: <%= User.find(a["created_by"]).full_name%>
Aircraft: <%= a["aircraft"].nil? ? 'None (Ground School)' : Aircraft.find(a["aircraft"]).type_and_identifier %> 
From: <%= a["from"].to_time.strftime("%a %b %d %I%p")%>
To: <%= a["to"].to_time.strftime("%a %b %d %I%p")%>

CHANGES:<%
%><% if a["o_status"] != a["status"] then %><%="\n"%> Status changed to <%= reservation.status == 'created' ? 'awaiting approval' : reservation.status %> <% end %><%
%><% if a["instructor"] != a["instructor_id"] then %><%="\n"%> Instructor changed to <%= reservation.instructor.nil? ? 'No Instructor' : reservation.instructor.full_name%> <% end %><%
%><% if a["aircraft"] != a["aircraft_id"] then %><%="\n"%> Aircraft changed to <%= reservation.aircraft.nil? ? 'No Aircraft/Ground School' : reservation.aircraft.type_and_identifier %> <% end %><%
%><% if a["from"] != a["time_start"] then %><%="\n"%> Start time changed to <%=reservation.time_start.strftime("%a %b %d %I%p") %> <% end %><%
%><% if a["to"] != a["time_end"] then %><%="\n"%> End time changed to <%= reservation.time_end.strftime("%a %b %d %I%p")%> <% end %>
<%}%>